import { reqGetBannerList, reqGetFloorData } from '@/api'
const state = {
  bannerList: [],
  floorData: []
}
const mutations = {
  GETBANNERLIST(state, bannerList) {
    state.bannerList = bannerList
  },
  GETFLOORDATA(state, floorData) {
    state.floorData = floorData
  }
}
const getters = {
}
const actions = {
  async getBannerList() {
    const result = await reqGetBannerList()
    if (result.code === 200) {
      this.commit('GETBANNERLIST', result.data)
    }
  },
  async getFloorData() {
    const result = await reqGetFloorData()
    if (result.code === 200) {
      this.commit('GETFLOORDATA', result.data)
      console.log('--------------------')
      console.log(result.data)
    }
  }
}

export default {
  state,
  mutations,
  getters,
  actions
}
